﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserLogin.aspx.cs" Inherits="EcSalseManage.UserLogin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>项目部销售管理系统-用户登陆</title>
        <script language="javascript" type="text/javascript" src="Js/jquery-1.6.2.min.js" ></script>
</head>

<style type="text/css">

body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #1D3647;
}

</style>
<script language="javascript" type="text/javascript">


    $(document).ready(function() {
        $("#btnLogin").click(function() {
                onLogin();
        });
    });

//XmlHttpRequest对象  
function createXmlHttpRequest() {
    if (window.ActiveXObject) { //如果是IE浏览器  
        return new ActiveXObject("Microsoft.XMLHTTP");
    } else if (window.XMLHttpRequest) { //非IE浏览器  
        return new XMLHttpRequest();
    }
}

var userName;
var passWord;
var xmlHttpRequest;  

function onLogin() {
    userName = $("#txtUserName").val();
    passWord = $("#txtUserPwd").val();

    var url = "http://wap.gzcentaline.com.cn/CCESWap/Login.aspx?txtUserName=" + userName + "&txtUserPwd=" + passWord + "";

    //1.创建XMLHttpRequest组建  
    xmlHttpRequest = createXmlHttpRequest();

    //2.设置回调函数  
    xmlHttpRequest.onreadystatechange = zswFun;

    //3.初始化XMLHttpRequest组建  
    xmlHttpRequest.open("POST", url, true);

    //4.发送请求  
    xmlHttpRequest.send(null);
}

//回调函数  
function zswFun() {
    if (xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200) {
        var b = xmlHttpRequest.responseText;
        if (b == "true") {
            alert("登录成功！");
        } else {
            alert("登录失败！");
        }
    }
}  

function Login(){
    if (Check()) {
        if (document.all.DropDownList1.value == "2") {
            if (document.getElementById("ckbRemenber").checked) {
                document.getElementById("HiddenField1").value = "1";
            }
            $("#__VIEWSTATE").attr("disabled", true);
            document.form1.action = "http://wap.gzcentaline.com.cn/CCESWap/LoginByEc.aspx";
            document.form1.submit();
            return false;
        } if (document.all.DropDownList1.value == "1") {
            return true;
        }

        
    }
    
}

function Check(){
    if ($("#txtUserName").val() == "")
    {
        alert("The user isn't empty");
        $("#txtUserName").focus();
        return false;
    }
    if ($("#txtUserPwd").val() == "")
    {
        alert("The Password isn't empty")
        $("#txtUserPwd").focus();
        return false;
    }
    return true;
}

function LoginSuccess(){
    $.ajax({
        type: "POST",
        url: "http://localhost/Login.aspx",
        data: { txtUserName: $("#txtUserName").val(), txtUserPwd: $("#txtUserPwd").val() },
        beforeSend: function() { $("#msg").html("logining"); },
        success: function(data) {
            $("#msg").html(decodeURI(data));
            alert("123");
        }
    });
    }


</script>


<link href="images/skin.css" rel="stylesheet" type="text/css">
<body>
<table width="100%" height="166" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="42" valign="top"><table width="100%" height="42" border="0" cellpadding="0" cellspacing="0" class="login_top_bg">
      <tr>
        <td width="1%" height="21">&nbsp;</td>
        <td height="42">&nbsp;</td>
        <td width="17%">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" height="532" border="0" cellpadding="0" cellspacing="0" class="login_bg">
      <tr>
        <td width="49%" align="right"><table width="91%" height="532" border="0" cellpadding="0" cellspacing="0" class="login_bg2">
            <tr>
              <td height="138" valign="top"><table width="89%" height="427" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="149">&nbsp;</td>
                </tr>
                <tr>
                  <td height="80" align="right" valign="top"><img src="images/logo.png" width="279" height="68"></td>
                </tr>
                <tr>
                  <td height="198" align="right" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="35%">&nbsp;</td>
                      <td height="25" colspan="2" class="left_txt"><p>1- 中原地产销售管理系统网站解决方案...</p></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td height="25" colspan="2" class="left_txt"><p>2- 一站通式的整合方式，方便用户使用...</p></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td height="25" colspan="2" class="left_txt"><p>3- 强大的后台系统，管理内容易如反掌...</p></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td width="30%" height="40"><img src="images/icon-demo.gif" width="16" height="16"><a href="images/项目销售系统说明书v1.0.pdf" target="_blank" class="left_txt3"> 使用说明</a> </td>
                      <td width="35%"><img src="images/icon-login-seaver.gif" width="16" height="16"><a href="" class="left_txt3"> 在线客服</a></td>
                    </tr>
                  </table></td>
                </tr>
              </table></td>
            </tr>
            
        </table></td>
        <td width="1%" >&nbsp;</td>
        <td width="50%" valign="bottom"><table width="100%" height="59" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="4%">&nbsp;</td>
              <td width="96%" height="38"><span class="login_txt_bt">登陆后台管理</span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td height="21"><table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table211" height="328">
                  <tr>
                    <td height="164" colspan="2" align="middle">
                    <form id="form1" method="post" runat="server">
                    <asp:HiddenField ID="HiddenField1" runat="server" />
                        <table cellSpacing="0" cellPadding="0" width="100%" border="0" height="143" id="table212">
                          <tr>
                            <td width="13%" height="38" class="top_hui_text"><span class="login_txt">工号：&nbsp;&nbsp; </span></td>
                            <td height="38"  align="left" colspan="2" class="top_hui_text"><asp:TextBox id="txtUserName" runat="server" Width="120px"></asp:TextBox>                           </td>
                          </tr>
                          <tr>
                            <td width="13%" height="35" class="top_hui_text"><span class="login_txt"> 密 码： &nbsp;&nbsp; </span></td>
                            <td height="35" colspan="2" align="left" class="top_hui_text"><asp:TextBox id="txtUserPwd" runat="server" Width="120px" TextMode="Password"></asp:TextBox>
                              <asp:CheckBox ID="ckbRemenber" runat="server" Text="记住我一周" Font-Size="10px" /> </td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                            <td colspan="2" align="left">
                                <asp:DropDownList ID="DropDownList1" runat="server">
                                    <asp:ListItem Value="1" Text="项目销售系统"></asp:ListItem>
                                     <asp:ListItem Value="2" Text="楼盘销售系统"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                          </tr>
                          <tr>
                            <td height="35" >&nbsp;</td>
                            <td width="10%" align="left" height="35" >
                                <asp:Button ID="ibtnLogin" runat="server" OnClientClick="return Login();" 
                                    Text="登陆" class="button" 
                                    style="height: 26px" onclick="ibtnLogin_Click" /><%--<input name="Submit" type="submit" class="button" id="Submit" value="登 陆" onclick="return Submit_onclick()">--%> </td>
                            <td width="67%" align="left" class="top_hui_text"><input name="cs" type="button" class="button" id="cs" value="取 消" onClick="showConfirmMsg1()"> </td>
                          </tr>
                          </table>
                        <br>
                    </form>
                    </td>
                  </tr>
                  <tr>
                    <td width="433" height="164" align="right" valign="bottom"><img src="images/login-wel.gif" width="242" height="138"></td>
                    <td width="57" align="right" valign="bottom">&nbsp;</td>
                  </tr>
              </table></td>
            </tr>
          </table>
          </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="login-buttom-bg">
      <tr>
        <td align="center"><span class="login-buttom-txt">Copyright &copy; 2011-2012 www.centaline.cn</span></td>
      </tr>
    </table></td>
  </tr>
</table>

</body>
</html>
